scale_friends <- function(str){
  if (str == "0") {
    return(1)
  }
  else if (str == "1-2") {
    return(2)
  }
  else if (str == "3-5") {
    return(3)
  }
  else if (str == "6-10") {
    return(4)
  }
  else if (str == "10+") {
    return(5)
  }
}

scale_describe <- function(str){
  if (str_detect(str, "Very few")) {
    return(1)
  }
  else if (str_detect(str, "Some are")) {
    return(2)
  }
  else if (str_detect(str, "About half")) {
    return(3)
  }
  else if (str_detect(str, "Most are")) {
    return(4)
  }
  else if (str_detect(str, "Almost all are")) {
    return(5)
  }
}

scale_often <- function(str){
  if (str == "Never") {
    return(1)
  }
  else if (str == "Rarely") {
    return(2)
  }
  else if (str == "Sometimes") {
    return(3)
  }
  else if (str == "Often") {
    return(4)
  }
  else if (str == "Very Often") {
    return(5)
  }
}

scale_agree_fwd <- function(str) {
  return(case_when(str == "Agree strongly" ~ 5,
                   str == "Agree somewhat" ~ 4,
                   str == "Neither agree nor disagree" ~ 3,
                   str == "Disagree somewhat" ~ 2,
                   str == "Disagree strongly" ~1))
}

scale_agree_rvrs <- function(str) {
  return(case_when(str == "Agree strongly" ~ 1,
                   str == "Agree somewhat" ~ 2,
                   str == "Neither agree nor disagree" ~ 3,
                   str == "Disagree somewhat" ~ 4,
                   str == "Disagree strongly" ~ 5))
}
